package com.iraeta.controller;

import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.iraeta.entity.main.Oadanganrenyuan;
import com.iraeta.service.basic.DataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController(value = "BasicDataController")
@RequestMapping("basicdata")
public class BasicDataController extends BaseController{
    @Autowired
    DataService dataService;

    /*分页查看OA人员档案*/
    @RequestMapping("pageoarenyuandangan")
    public String pageOaRenYuanDangAn(@RequestBody JSONObject paramJb){
        String idCard = paramJb.getString("idCard");
        String name = paramJb.getString("name");
        this.pageSet(paramJb);
        List<Oadanganrenyuan> oadanganrenyuanList = dataService.listOadanganrenyuan(idCard, name);
        PageInfo<Oadanganrenyuan> dataPageInfo = this.getPageInfo(oadanganrenyuanList);
        return this.success(dataPageInfo);
    }
}
